Fix #132: correct tab order in New Connection dialog (General & Groups)#271
Open
eran132 wants to merge 1 commit into
Open
Fix #132: correct tab order in New Connection dialog (General & Groups)#271eran132 wants to merge 1 commit into
eran132 wants to merge 1 commit into
Conversation
The General and Groups sections of the New Connection dialog had random and colliding TabIndex values (e.g. multiple controls at TabIndex 0/1 in Groups, and Save-password at TabIndex 6 in General), which made keyboard navigation jump around the form. Reassign TabIndex on both user controls to follow the visible reading order (top to bottom, then left to right). No layout or behavior changes; only TabIndex values are altered. Adds NewTerminalTabOrderTests asserting each section's tab order follows reading order and that focusable controls do not share a tab index. Fixes Terminals-Origin#132 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds regression tests to prevent tab-order regressions in the “New Connection” dialog UI, specifically ensuring consistent keyboard navigation for the General and Groups sections (issue #132).
Changes:
- Added MSTest coverage that validates tab order follows visual reading order (top-to-bottom, left-to-right).
- Added MSTest coverage that asserts focusable controls don’t share TabIndex values.
- Registered the new test file in the Tests project.
Reviewed changes
Copilot reviewed 2 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| Source/Tests/UserInterface/NewTerminalTabOrderTests.cs | Introduces new UI regression tests for tab order reading-order and TabIndex uniqueness. |
| Source/Tests/Tests.csproj | Includes the new test file in compilation. |
Files not reviewed (2)
- Source/Terminals/Forms/EditFavorite/GeneralPropertiesUserControl.Designer.cs: Language not supported
- Source/Terminals/Forms/EditFavorite/GroupsControl.Designer.cs: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+95
to
+100
| private static IEnumerable<Control> FocusableControls(Control container) | ||
| { | ||
| // Labels (TabStop == false) and hidden alternates are skipped by real tab | ||
| // navigation, so they are excluded here too. | ||
| return container.Controls.Cast<Control>().Where(c => c.TabStop && c.Visible); | ||
| } |
Comment on lines
+25
to
+30
| [TestMethod] | ||
| public void GeneralProperties_TabOrder_FollowsReadingOrder() | ||
| { | ||
| using (var control = new GeneralPropertiesUserControl()) | ||
| AssertReadingOrder(control); | ||
| } |
Comment on lines
+16
to
+18
| [TestClass] | ||
| public class NewTerminalTabOrderTests | ||
| { |
Comment on lines
+19
to
+23
| /// <summary> | ||
| /// Controls on the same visual row may differ slightly in Top (a label and | ||
| /// its field are not pixel aligned). Treat anything within this band as one row. | ||
| /// </summary> | ||
| private const int RowTolerance = 12; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #132. The General and Groups sections of the New Connection dialog had random / colliding
TabIndexvalues, so keyboard navigation jumped around the form instead of following the visible layout.Examples of the problem in the current code:
GroupsControlhad three controls atTabIndex = 0and three atTabIndex = 1(lvConnectionTags,AllTagsListView,txtGroupName,btnRemoveTag,AllTagsAddButton…).GeneralPropertiesUserControlhadchkSavePasswordatTabIndex = 6while the fields above it (cmbServers,txtPort,txtName) sat at 24–28, so Tab jumped from the bottom checkbox back up to the server field.Change
Reassigned
TabIndexon both user controls to follow the visible reading order (top‑to‑bottom, then left‑to‑right). OnlyTabIndexvalues change — no layout, control, or behavior changes. Mnemonic labels now sit immediately before their field, soAlt‑mnemonics focus the intended control.Tests
Added
Source/Tests/UserInterface/NewTerminalTabOrderTests.cs(4 tests) asserting, for each section, that:TabIndex.Verified the tests are meaningful: they fail on the pre‑fix designers and pass after the fix. The rest of the suite is unchanged (the only pre‑existing failures locally are the SQL/LocalDB persistence tests, which need a database).
🤖 Generated with Claude Code